﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Model;
using BLL;
namespace UI
{
    public partial class 系统添加 : Form
    {
        public 系统添加()
        {
            InitializeComponent();
        }
        //添加按钮
        private void btnTianJia_Click(object sender, EventArgs e)
        {
            Admins.UserName = this.txtName.Text;
            Admins.UserPwd = this.txtPwd.Text;
            Admins.UserCompellation = this.txtZhenShiName.Text;
            if (this.txtPwd.Text==this.txtQueRenPwd.Text)
            {
                int count = 系统设置BLL.AddCaoZuoYuan();
                if (count>0)
                {
                    MessageBox.Show("添加成功");
                    this.Close();
                    new 系统设置().Show();
                }
                else
                {
                    MessageBox.Show("添加失败");
                }
            }
            else
            {
                MessageBox.Show("两次密码不一致");
            }
        }
        //关闭按钮
        private void btnGuanBi_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("您确定要关闭吗？","温馨提示",MessageBoxButtons.YesNo,MessageBoxIcon.Stop);
            if (dr.ToString()=="Yes")
            {
                this.Close();
            }
        }
    }
}
